//
//  SRSettingBirthdayView.m
//  SportRing
//
//  Created by Apple on 14/10/24.
//  Copyright (c) 2014年 HotOne. All rights reserved.
//

#import "SRSettingBirthdayView.h"


@interface SRSettingBirthdayView ()<FRDatePickerViewDelegate>

@property (nonatomic, weak)IBOutlet UIView *frDatePickViewContainerView;


-(void)setDatePickView;


@end

@implementation SRSettingBirthdayView

-(void)awakeFromNib
{
    [super awakeFromNib];
    
    [self setDatePickView];

}

-(void)setDatePickView{
    
    NSDate * defaultDate = [NSDate date];
    
    FRDatePickerView *frDatePickView = [[FRDatePickerView alloc] initWithFrame:CGRectMake(0, 0, self.frDatePickViewContainerView.frame.size.width, self.frDatePickViewContainerView.frame.size.height) defaultDate:defaultDate];
    
    frDatePickView.delegate = self;
    
    [self.frDatePickViewContainerView addSubview:frDatePickView];
    [self.delegate defaultValue:defaultDate];
}

#pragma mark - FRDatePickerViewDelegate

- (void)currentSelectedDate:(NSDate *)date inPickerView:(FRDatePickerView *)pickerView{
    [self.delegate didSelectBirthday:date];
}

@end
